-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial Cluster Actuator Implementation #17
Initial Cluster Actuator Implementation #17
Conversation
Defines a top-level AzureClient interface to hold all clients and operations for creating and checking for existence of an NSG
This is now handled by the cluster actuator
} | ||
|
||
func (azure *AzureClusterClient) Delete(cluster *clusterv1.Cluster) error { | ||
//TODO: get rid of the whole resource group? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would this be the right thing to do? Figuring out the dependencies in the cluster between virtual machines and the created NICs and SG would be a hassle. Would there be a case when the Delete
operation shouldn't be tearing down all cluster resources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think deleting the whole resource group sounds like a good initial implementation. Figuring out resource dependencies is a nightmare and I don't see a use case where a Delete
operation shouldn't delete all cluster resources.
if err != nil { | ||
return err | ||
} | ||
networkSGFuture, err := azure.network().CreateOrUpdateNetworkSecurityGroup(clusterConfig.ResourceGroup, "ClusterAPINSG", clusterConfig.Location) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should move this to a const under securitygroups.go
and default to that name if no SG name is provided.
Refer to that defined constant from machineactuator.go
as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please. Even better if we have a module just for constants.
Hi @marwanad, I'll get back to you with a review later today. In the meantime, can you check your PR's Travis build: https://travis-ci.org/platform9/azure-provider/builds/442404123? |
198736b
to
eef1efe
Compare
eef1efe
to
25ece3b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass. Overall LGTM. We don't have a style guide right now but we should adopt one. The long lines doesn't work well with GitHub's rather large paddings so I find myself scrolling to the right to see an entire line.
if err != nil { | ||
return err | ||
} | ||
networkSGFuture, err := azure.network().CreateOrUpdateNetworkSecurityGroup(clusterConfig.ResourceGroup, "ClusterAPINSG", clusterConfig.Location) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please. Even better if we have a module just for constants.
} | ||
|
||
func (azure *AzureClusterClient) Delete(cluster *clusterv1.Cluster) error { | ||
//TODO: get rid of the whole resource group? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think deleting the whole resource group sounds like a good initial implementation. Figuring out resource dependencies is a nightmare and I don't see a use case where a Delete
operation shouldn't delete all cluster resources.
@@ -64,6 +65,12 @@ func (azure *AzureClusterClient) Reconcile(cluster *clusterv1.Cluster) error { | |||
if err != nil { | |||
return fmt.Errorf("error loading cluster provider config: %v", err) | |||
} | |||
|
|||
_, err = azure.resourcemanagement().CreateOrUpdateGroup(clusterConfig.ResourceGroup, clusterConfig.Location) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the resource group creation and updating should be part of the cluster reconciliation loop
978ee36
to
fa302b1
Compare
Deletes the cluster resource group
61e8dc1
to
be783ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This moves the responsibility of creating and reconciling the NSG to the cluster actuator. (I'll be moving the VNet in a separate PR).
I tested the reconciliation to the SSH rule by deleting the rule through the portal and waiting for the cluster controller to reconcile.
Working towards #9